home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8735 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Trying to do weird function overloading
  5. Date: 26 Feb 1996 11:31:51 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4gs5n7$bc5@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe18.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Feb 26, 1996 00:36:31 in article <Trying to do weird function
  15. overloading>, 'millert@scheifler.csee.usf.edu (Timothy Miller)' wrote: 
  16.  
  17.  
  18. >Ok... here's a piece of one of my classes: 
  19. >friend Color scale(Color c1, double f); 
  20. >friend Color scale(double f, Color c2); 
  21. >Color scale(double f) { return scale(*this, f); }    
  22. >In the member function, I'm trying to call the friend function, but the  
  23. >compiler is thinking that I'm trying to call the member function.  Now,  
  24. >if I were trying to do this the other way around, I could use the scope  
  25. >resolution operator to tell the friend function that I'm trying to access 
  26.  
  27. >the member function (even though I wouldn't need to, right?).  But here,  
  28. >I'm trying to do the exact opposite... so how would I scope resolve
  29. outward? 
  30. You can use the scope resolution operator in your case also. 
  31.     ::Color(...) 
  32.  
  33. -- 
  34. Pete Grant 
  35. Kalevi, Inc. 
  36. Software Engineering & development
  37.